import java.util.Deque;
import java.util.LinkedList;
import java.util.Queue;

public class Odeque {

    public static void main(String[] args) {
        
        Deque<String> deq = new LinkedList<>();
        deq.addLast("A");
        deq.addFirst("A0");
        deq.addLast("B");

        // System.out.println(deq.toString());

        // deq.removeFirst();

        // System.out.println(deq.toString());

        // deq.removeLast();

        // System.out.println(deq.toString());



        //stack  LIFO：Last In First Out
        Deque<String> stackList = new LinkedList<>();
        stackList.push("A");
        stackList.push("B");
        stackList.push("C");

        System.out.println(stackList.pop());

        System.out.println(stackList.toString());


        

    }
    
}